<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<%@include file="../common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>配置生效日期</title>
		<link type="text/css" href="${ctx}/css/style.css" rel="stylesheet" />
		<link type="text/css" href="${ctx}/css/forms.css" rel="stylesheet" />
		<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
		<script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="${ctx}/js/common.js"></script>
		<script type="text/javascript">
			function save() {
				var beginDateMode = $("input:radio[name='beginDateMode']:checked").val();
				if (beginDateMode == "set" && $("#beginDate").val() == "") {
					alert("请选择开始日期");
					return false;
				}
				if ($("#endDate").val() == "") {
					alert("请选择结束日期");
					return false;
				}
				window.returnValue = $("#beginDate").val() + "&" + $("#endDate").val() + "&" + beginDateMode;
				self.close();
			}
		</script>
	</head>
	<body style="background-image: none;">
		<table border="0" cellpadding="0" cellspacing="0" class="bg1_1" width="96%">
			<tr>
				<td width="120" height="30" align="right">生效开始日期<span class="red">*</span>：</td>
				<td>
					<input name="beginDateMode" value="now" type="radio"${empty beginDate ? ' checked' : ''} onclick="$('#div_begin_date').hide();" />立即生效
					<input name="beginDateMode" value="set" type="radio"${empty beginDate ? '' : ' checked'} onclick="$('#div_begin_date').show();" />设定日期
					<span id="div_begin_date" style="width:50%;${empty beginDate ? 'display:none;' : ''}">
						<input id="beginDate" name="beginDate" value="${beginDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00', minDate:'%y-%M-%d H:mm'})" />
					</span>
				</td>
			</tr>
			<tr>
				<td width="100" height="30" align="right">结束日期<span class="red">*</span>：</td>
				<td>
					<input id="endDate" name="endDate" value="${endDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00', minDate:'#F{$dp.$D(\'beginDate\')}'})" />
				</td>
			</tr>
		</table>
		<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top: 20px;">
			<tr>
				<td height="40" colspan="4" align="center">
					<input type="button" value="保存 " onclick="save();" />
					<input type="button" value="关闭" onclick="self.close();" />
				</td>
			</tr>
		</table>
	</body>
</html>